#ifndef CIRCLE_HPP
#define CIRCLE_HPP

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include "BoundingVolume.hpp"

#include <SmegTools/Config.h>
#include <SmegTools/Debug/DebugNew.hpp>

namespace smeg {
    namespace math {

class Circle : public BoundingVolume
{
public:
    ////////////////////////////////////////////////////////////
    /// Default Constructor
    ///
    /// \param _Center : Center of the BoundingBox
    /// \param _fRadius : Radius of circle
    ///
    ////////////////////////////////////////////////////////////
                        Circle( const sf::Vector2f& _Center = sf::Vector2f(), 
                                    float _fRadius = 1.0f );
    ////////////////////////////////////////////////////////////
    /// Copy Constructor
    ///
    /// \param _Copy
    ///
    ////////////////////////////////////////////////////////////
                        Circle( const Circle& _Copy );
    ////////////////////////////////////////////////////////////
    /// Destructor
    ///
    ////////////////////////////////////////////////////////////
    virtual             ~Circle();

    DECLARE_CLONE_FUNC( Circle, BoundingVolume )
    
    ////////////////////////////////////////////////////////////
    /// Does the Bounding Volume overlaps with a Bounding Volume
    ///
    /// \param _Other : Other Volume to test
    ///
    /// \return Whether the _Other Bounding Volume overlaps with this Bounding Volume
    ///
    ////////////////////////////////////////////////////////////
    virtual bool        Overlaps( const BoundingBox& _Other ) const;
    virtual bool        Overlaps( const Line& _Other ) const;
    virtual bool        Overlaps( const Circle& _Other ) const;
    
    ////////////////////////////////////////////////////////////
    /// Does the Bounding Volume contains a Bounding Volume
    ///
    /// \param _Other : Other Volume to test
    ///
    /// \return Whether this contains the _Other Bounding Volume
    ///
    ////////////////////////////////////////////////////////////
    virtual bool        Contains( const BoundingBox& _Other ) const;
    virtual bool        Contains( const Line& _Other ) const;
    virtual bool        Contains( const Circle& _Other ) const;

    ////////////////////////////////////////////////////////////
    /// Does the Bounding Volume contains a point
    ///
    /// \param _Point : Point to test
    ///
    /// \return Whether this contains the point
    ///
    ////////////////////////////////////////////////////////////
    virtual bool        Contains( const sf::Vector2f& _Point ) const;

    /*********************** Accessors ************************/
    void                SetRadius( float _fRadius );
    float               GetRadius() const;

    virtual float       GetPseudoRadius() const;

#ifdef _DEBUG
    virtual void        DebugRender( sf::RenderWindow* _pRenderWindow, const sf::Color& _Color = sf::Color::White, bool _bFull = false ) const;
#endif // _DEBUG
};

/************************** Inline ************************/
inline void Circle::SetRadius( float _fRadius ) {
    m_HalfSize.x = m_HalfSize.y = _fRadius;
    m_Size = m_HalfSize * 2.0f;
}

inline float Circle::GetRadius() const {
    return m_HalfSize.x;
}

inline float Circle::GetPseudoRadius() const {
    return GetRadius();
}
    } // smeg::math
} // smeg

#include <SmegTools/Debug/DebugNewOff.hpp>

#endif // CIRCLE_HPP
